import 'package:flutter/material.dart';
import 'package:jicaimao_flutter/utils/http_utils.dart';
import 'package:jicaimao_flutter/views/mine/FortunBagDatils.dart';

class MyFortuneBag extends StatefulWidget {


  @override
  _MyFortuneBagState createState() => new _MyFortuneBagState();
}

class _MyFortuneBagState extends State<MyFortuneBag> {


  @override
  void initState() {
    super.initState();
    print('网络请求');
    // 网络请求数据
    _loadData();
  }
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return  new Scaffold(
        appBar: new AppBar(
           iconTheme: IconThemeData(
             color: Colors.white
           ),
            centerTitle: true,
            backgroundColor: Color(0xFFEF5350),
            title: new Text(
              '我的福袋',
              style: new TextStyle(color: Colors.white, fontSize: 16.0),
            ),
          actions: <Widget>[

            new Container(
              height: 50.0,
              padding: EdgeInsets.fromLTRB(15.0,20.0,15.0,0.0),
              child:  GestureDetector(
               onTap: (){
                  Navigator.push(context,MaterialPageRoute(builder: (context) => FortunBagDatils()));
               },
                child: Text('领取详情'),
              ),
            ),

          ],
        ),
        body: new Container(
          margin: EdgeInsets.fromLTRB(150.0, 250.0, 150.0, 0.0),
          child: new Column(
            children: <Widget>[
              Image.asset('images/no_data.png' ,width: 80.0,height: 80.0,),
              Text('暂无数据')

            ],
          )
        )
      );

  }

 
 /// 网络获取数据

  Future _loadData()  async{
  print('网络请求 222');
  String url = 'homepage/getfinanceListOne';
  var response =  HttpUtil.getInstance().post(url);
//
  print(response);

  }


}



